import request from '@/utils/request'

export function allLeaveList (query)  {
  return request({
    url: 'system/leave/list',
    method: 'get',
    params: query
  })
}
export function updateLeaveStatus(id, reason, type) {
  return request({
    url: 'system/leave/updateLeaveStatus/' ,
    method: 'get',
    params: {
      id: id,
      reason: reason,
      type: type
    }
  })
}

export function getDoctorLeaveInfo ()  {
  return request({
    url: 'system/leave/getDoctorLeaveInfo',
    method: 'get',
  })
}

export function getLeaveInfoList (query)  {
  return request({
    url: 'system/leave/getLeaveInfoList',
    method: 'get',
    params: query
  })
}

// 修改用户
export function updateLeaveInfo(data) {
  return request({
    url: 'system/leave/updateLeaveInfo',
    method: 'put',
    data: data
  })
}

export function addLeaveInfo (data)  {
  return request({
    url: 'system/leave/addLeaveInfo',
    method: 'post',
    data: data
  })
}
